package demo7;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-08-05
 * Time: 8:29
 */
public class PaperFolding {


    public static void folding(int N){
        folding_child(1,N,true);//从第一层开始,一直打印N层,true为凹
    }
    //相当于中序遍历
    private static void folding_child(int i,int N,boolean down){
        if(i>N) return;//如果当前层大于N立即返回
        folding_child(i+1,N,true);//遍历下一层的凹
        System.out.print(down==true ? "凹":"凸");
        folding_child(i+1,N,false);
    }

    public static void main(String[] args) {
        int N = 3;//代表3层
        folding(N);
    }

}
